using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using DTO;
using System.Data;

namespace HeThongDAO
{
    public class PhieuThuDAO
    {
        public static void ThemPhieuThu(PhieuThuDTO pt)
        {
            string sql = "insert into PHIEU_THU(MaKhachHang,NgayThu,SoTienThu) values(@makh,'@ngaythu',@sotienthu)";
            sql = sql.Replace("@makh",pt.IMaKhachHang.ToString());
            sql = sql.Replace("@ngaythu", pt.DateNgayThu.ToString("MM/dd/yyyy"));
            sql = sql.Replace("@sotienthu", pt.DSoTienThu.ToString());
            Config.AccessHelper.ExecuteNonQuery(sql);

        }
        public static DataTable LayDanhSach()
        {
            string sql = "select * from PHIEU_THU";
            return Config.AccessHelper.ExecuteQuery(sql);
        }

        public static DataTable DocCauTruc()
        {
            string tenbang = "PHIEU_THU";
            return Config.AccessHelper.Doc_Cau_Truc("PHIEU_THU");
        }
    }
}
